/*
 * Utilities.java
 *
 * Created on 20 luglio 2005, 17.38
 *
 * @version 1.1
 * @author Federico Paparoni
 *
 */

package com.javastaff.btfree;

public class Utilities {
    
    public Utilities() {
    }
    
    static int arrayToInt(byte[] pBytes) {
		return (int)(pBytes[3] << 24 | pBytes[2] << 16 | pBytes[1] << 8 | pBytes[0]);
    }

    static byte[] intToArray(int val) {
        byte[] pBytes=new byte[4];
        pBytes[0] = (byte)val;
        pBytes[1] = (byte)(val >> 8);
        pBytes[2] = (byte)(val >> 16);
        pBytes[3] = (byte)(val >> 24);
        return pBytes;
    }
    
}
